<template>
    <view :class="{ yejian: if_theme_dark }">
        
        <view class="lz-status_bar">
            <view class="lz-top_view"></view>
        </view>
       
		
        <view class="kaoshi-head">
           <view class="kaoshi-head-top">
                <view class="kaoshi-head-left" @click="over_dati()">
                    <view class="iconfont icon-zuojiantou"></view>
                </view>
                <view class="kaoshi-head-m">
                    模拟考试
                </view>
                <view class="kaoshi-head-right">
                    <view class="iconfont icon-sey-A-add-a" @tap="show_change_moshi = true"></view>
                </view>
            </view>
        </view>
		<view style="height: 90px;width: 100%;"></view>
		<!-- 滚动通知 -->
		<view style="display: flex;flex-flow: row nowrap; width: 100%;background-color:#fdf6ec;padding-left: 20rpx;">
			<u-icon style="position: relative;left: 20rpx;"  name="info-circle" color="#f9ae3d" size="20"></u-icon>
			<u-notice-bar direction="row" duration="2000" style="height: 40rpx;" icon=' ' speed="80" fontSize="12" :text="noticetext"></u-notice-bar>
		</view>
		
        <swiper
                class="swiper"
                :autoplay="false"
                :current="current"
                style="height: calc(100vh - 200upx);"
                :duration="0"
                @change="swiper_change"
        >
            <swiper-item>
                <scroll-view scroll-y style="height: 100%;">
                    <view class="questionBankAnswer"
                            :class="{font1: font_size_type === 1,font2: font_size_type === 2,font3: font_size_type === 3,font4: font_size_type === 4}"
                            v-if="last_timu && last_timu.id">
                        <view class="questionBankAnswer-flex">
                            <view class="questionBankAnswer-top-l">
                                <view class="questionBankAnswer-top">
                                    <span style="font-size:18px;font-weight: 700;">
                                		第{{ timu_order }}题
                                	</span>
                                </view>
                                <view class="questionBankAnswer-tx">
									<span v-if="last_timu.type == 1">
										单选
									</span>
									<span v-if="last_timu.type == 2">
										多选
									</span>
									<span v-if="last_timu.type == 3">
										判断
									</span>
									<span v-if="last_timu.type == 4">
										填空
									</span>
									<span v-if="last_timu.type == 5">
										简答
									</span>
									<span v-if="last_timu.type == 6">
										阅读理解
									</span>
									<span v-if="last_timu.type == 7">
										完形填空
									</span>
									<span v-if="last_timu.type == 8">
										翻译
									</span>
									<span v-if="last_timu.type == 9">
										写作
									</span>
								<!-- {{ last_timu.type == 1 ? "单选" : last_timu.type == 2 ? "多选" : "判断" }} -->
                                </view>
                            </view>
                            <view class="questionBankAnswer-top-r" v-show="last_timu.id">编号:{{ last_timu.id }}
                            </view>
                        </view>
                        <view class="questionBankAnswer-title">{{ last_timu.question_name }}
                        </view>
                    </view>
                    <!-- type 1单选 2多选 3判断 -->
                    <view class="questionBankAnswer-content"
                            :class="{font1: font_size_type === 1,font2: font_size_type === 2,font3: font_size_type === 3,font4: font_size_type === 4}"
                            v-if="last_timu && last_timu.answers">
                        <block v-for="(item, index) in last_timu.answers" :key="index">
                            <view class="questionBankAnswer-content-menu"
							@click="last_timu==last_timu.answers?'':''"
							>
                                <view class="questionBankAnswer-content-num">
                                    {{ item.answer_code }}
                                </view>
                                <view class="questionBankAnswer-content-txt">
									<rich-text :nodes="item.answer"></rich-text>
								<!-- {{ item.answer }} -->
                                </view>
                            </view>
                        </block>
                    </view>
                </scroll-view>
            </swiper-item>
            <swiper-item v-if="current_timu.type==6 ||  current_timu.type==7">
				
				<movable-area style="height:70%;width: 100%; " >
                <!-- <scroll-view scroll-y style="height: 100%;"> -->
                    <view :style="'height:'+uphg+'px'" class="questionBankAnswer height50"
                            :class="{font1: font_size_type === 1,font2: font_size_type === 2,font3: font_size_type === 3,font4: font_size_type === 4}"
                            v-if="current_timu && current_timu.id">
							<view class="" style=" padding-bottom:16px;font-size:28rpx" v-if="current_timu.desc">
							     {{current_timu.desc}}
							</view>
                           <view class="questionBankAnswer-flex">
							 
                            <view class="questionBankAnswer-top-l">
                                <view class="questionBankAnswer-top">
                                    <span style="font-size:18px;font-weight: 700;">
                                		第{{ timu_order }}题
                                	</span>
                                </view>
                                <view class="questionBankAnswer-tx">
									<span v-if="current_timu.type == 1">
										单选
									</span>
									<span v-if="current_timu.type == 2">
										多选
									</span>
									<span v-if="current_timu.type == 3">
										判断
									</span>
									<span v-if="current_timu.type == 4">
										填空
									</span>
									<span v-if="current_timu.type == 5">
										简答
									</span>
									<span v-if="current_timu.type == 6">
										阅读理解
									</span>
									<span v-if="current_timu.type == 7">
										完形填空
									</span>
									<span v-if="current_timu.type == 8">
										翻译
									</span>
									<span v-if="current_timu.type == 9">
										写作
									</span>
									<span v-if="current_timu.type == 10">
										计算题
									</span> 
								<!-- {{ current_timu.type == 1 ? "单选" : current_timu.type == 2 ? "多选" : "判断" }} -->
                                </view>
                            </view>
                        </view>
                        <view class="questionBankAnswer-title">
						 <rich-text :nodes="current_timu.question_name"></rich-text> 
						<!-- {{ current_timu.question_name}} -->
                        </view>
                    </view>
                    <view style="height:54rpx;">
                    	<movable-view @change="move"  class="drag"  direction="vertical" friction="5" :y="y" >
                    	  <image style="width: 90px;height: 28px;" src="../../../static/img/dragimg.jpg"></image>
                    	</movable-view>
                    </view>
					<scroll-view scroll-y :style="'height:'+belowhg+'px'">
						<view class="questionBankAnswer-content"
								:class="{font1: font_size_type === 1,font2: font_size_type === 2,font3: font_size_type === 3,font4: font_size_type === 4 }"
								v-if="current_timu && current_timu.answers">
							<block v-for="(item, index) in current_timu.answers" :key="index" v-if="current_timu.type==1 || current_timu.type==2 ||current_timu.type==3">
								<view class="questionBankAnswer-content-menu"
										@tap="post_answer(item, index)"
										:class="{font1: font_size_type === 1,font2: font_size_type === 2,font3: font_size_type === 3,font4: font_size_type === 4}">
									<!-- 用户选择错误答案显示特殊样式 -->
									<view
											class="questionBankAnswer-content-num"
											:class="{active : copy_user_answer &&  copy_user_answer[current_timu.id][index].active}">
										{{ item.answer_code === "1" ? "A" : item.answer_code === "0" ? "B" : item.answer_code }}
									</view>
									<view class="questionBankAnswer-content-txt">
										<rich-text :nodes="item.answer"></rich-text>
									<!-- {{item.answer }} -->
									</view>
								</view>
							</block>
							<block  v-if="current_timu.type==4">
							<!-- 	 <view  style="font-size:22rpx;color:red; margin-top: 10rpx;">
									注*：可以选择输入答案或者拍照上传,两者选其一
								 </view> -->
								 
								 <view v-if="current_timu.type_answer==2" style="  margin-top: 10rpx;border-radius: 20rpx; margin-bottom:20rpx"   > 
								 
									 <input v-if="tiankongArray[current_timu.id]" type="text" @input="onInput" :value="tiankongArray[current_timu.id]"  placeholder="请输入你的答案" placeholder-style="color:#666;" style="height: 80rpx; border: 1px solid #eee;  padding: 0 20rpx;margin-top:20rpx;border-radius:8rpx; " />
									 <input v-else type="text" @input="onInput"   placeholder="请输入你的答案" placeholder-style="color:#666;" style="height: 80rpx; border: 1px solid #eee;  padding: 0 20rpx;margin-top:20rpx;border-radius:8rpx; " />
								 </view>
								 <view v-if="current_timu.type_answer==1" style="background:#f6f6f6;height: 300rpx;margin-top: 20rpx;border-radius: 20rpx;text-align:center;margin-bottom:20rpx" @tap="uploadImage" >
								 	<view v-if="imgurlArray[current_timu.id]">
								 		<image :src=" imgurlArray[current_timu.id]" mode="heightFix" style="max-height: 300rpx;"></image>
								 		 
								 	</view>
								 	<view v-else>
								 		<image src="../../../static/img/photo.png" mode="widthFix" style="width:100rpx;margin-top:80rpx"></image>
								 		<view style="font-size:28rpx;color:#e6e6e6">
								 			支持拍照上传
								 		</view>
								 	</view>
								 	
							    </view>
							</block>
							<block  v-if="current_timu.type==5 || current_timu.type==8 || current_timu.type==9 || current_timu.type==10">
								
								<!-- <block v-if="current_timu.type==4">
								   <view style="  margin-top: 10rpx;border-radius: 20rpx; margin-bottom:20rpx"   >
								   
									   <input v-if="tiankongArray[current_timu.id]" type="text" @input="onInput" :value="tiankongArray[current_timu.id]"  placeholder="请输入你的答案" placeholder-style="color:#666;" style="height: 80rpx; border: 1px solid #eee;  padding: 0 20rpx;margin-top:20rpx;border-radius:8rpx; " />
									   <input v-else type="text" @input="onInput"   placeholder="请输入你的答案" placeholder-style="color:#666;" style="height: 80rpx; border: 1px solid #eee;  padding: 0 20rpx;margin-top:20rpx;border-radius:8rpx; " />
								   </view>
								</block>
								
								<block v-else>
								   <view style="  margin-top: 10rpx;border-radius: 20rpx; margin-bottom:20rpx"> 
									   <textarea v-if="tiankongArray[current_timu.id]"   @input="onInput" :value="tiankongArray[current_timu.id]"  placeholder="请输入你的答案" placeholder-style="color:#666;" style="width:92%;height: 300rpx; border: 1px solid #eee;  padding:   20rpx;margin-top:20rpx;border-radius:8rpx; " />
									   <textarea v-else   @input="onInput"   placeholder="请输入你的答案" placeholder-style="color:#666;" style="height: 300rpx; border: 1px solid #eee;  padding: 20rpx;margin-top:20rpx;border-radius:8rpx;width:92% " />
								   </view>
								</block> -->
								<view style="background:#f6f6f6;height: 300rpx;margin-top: 20rpx;border-radius: 20rpx;text-align:center;margin-bottom:20rpx" @tap="uploadImage" > 
									<view v-if="imgurlArray[current_timu.id]">
										<image :src=" imgurlArray[current_timu.id]" mode="heightFix" style="max-height: 300rpx;"></image>
										 
									</view>
									<view v-else>
										<image src="../../../static/img/photo.png" mode="widthFix" style="width:100rpx;margin-top:80rpx"></image>
										<view style="font-size:28rpx;color:#e6e6e6">
											支持拍照上传
										</view>
									</view>
									
									 
									<!-- <input type="text" @input="onInput"   placeholder="请输入你的答案" placeholder-style="color:#666;" style="height: 80rpx; border: 1px solid #eee;  padding: 0 20rpx;margin-top:20rpx;border-radius:8rpx; " /> -->
								</view>
							</block>
							<block  v-if="current_timu.type==6 || current_timu.type==7 ">
								<view class="questionBankAnswer-title"><rich-text :nodes="current_timu.sonquestion_name"></rich-text></view>
								<block v-for="(item, index) in current_timu.answers" :key="index" v-if="current_timu.sontype==1 || current_timu.sontype==2 ||current_timu.sontype==3">
									<view class="questionBankAnswer-content-menu"
											@tap="post_answer(item, index)"
											:class="{font1: font_size_sontype === 1,font2: font_size_sontype === 2,font3: font_size_sontype === 3,font4: font_size_sontype === 4}">
										<!-- 用户选择错误答案显示特殊样式 -->
										<view
												class="questionBankAnswer-content-num"
												:class="{active : copy_user_answer &&  copy_user_answer[current_timu.id][index].active}">
											{{ item.answer_code === "1" ? "A" : item.answer_code === "0" ? "B" : item.answer_code }}
										</view>
										<view class="questionBankAnswer-content-txt">
											<rich-text :nodes="item.answer"></rich-text>
										<!-- {{item.answer }} -->
										</view>
									</view>
								</block>
								
							</block>
						</view>
						
						<view :class="{font1: font_size_type === 1,font2: font_size_type === 2,font3: font_size_type === 3,font4: font_size_type === 4}"
								v-if="current_timu.answers && current_timu.type == 2">
							<button
									:class="is_duoxuan_sub ? 'duoxuan_checked' : 'duoxuan'"
									type=""
									@tap="post_answer_req"
							>
								{{ is_duoxuan_sub ? "提交成功" : "选择后点击提交" }}
							</button>
						</view>
					</scroll-view>
				</movable-area>
            </swiper-item>
            <swiper-item v-else>
				 
                <scroll-view scroll-y style="height: 100%;">
                    <view class="questionBankAnswer"
                            :class="{font1: font_size_type === 1,font2: font_size_type === 2,font3: font_size_type === 3,font4: font_size_type === 4}"
                            v-if="current_timu && current_timu.id">
							<view class="" style="padding-bottom:16px;font-size:28rpx" v-if="current_timu.desc">
							     {{current_timu.desc}}
							</view>
                        <view class="questionBankAnswer-flex">
                            <view class="questionBankAnswer-top-l">
								
                                <view class="questionBankAnswer-top">
                                    <span style="font-size:18px;font-weight: 700;">
                                		第{{ timu_order }}题
                                	</span>
                                </view>
                                <view class="questionBankAnswer-tx">
            						<span v-if="current_timu.type == 1">
            							单选
            						</span>
            						<span v-if="current_timu.type == 2">
            							多选
            						</span>
            						<span v-if="current_timu.type == 3">
            							判断
            						</span>
            						<span v-if="current_timu.type == 4">
            							填空
            						</span>
            						<span v-if="current_timu.type == 5">
            							简答
            						</span>
            						<span v-if="current_timu.type == 6">
            							阅读理解
            						</span>
            						<span v-if="current_timu.type == 7">
            							完形填空
            						</span>
            						<span v-if="current_timu.type == 8">
            							翻译
            						</span>
            						<span v-if="current_timu.type == 9">
            							写作
            						</span>
            						<span v-if="current_timu.type == 10">
            							计算题
            						</span> 
            					<!-- {{ current_timu.type == 1 ? "单选" : current_timu.type == 2 ? "多选" : "判断" }} -->
                                </view>
                            </view>
                        </view>
                        <view class="questionBankAnswer-title">
            			 <rich-text :nodes="current_timu.question_name"></rich-text> 
            			<!-- {{ current_timu.question_name}} -->
                        </view>
                    </view>
                    <view
                            class="questionBankAnswer-content"
                            :class="{font1: font_size_type === 1,font2: font_size_type === 2,font3: font_size_type === 3,font4: font_size_type === 4 }"
                            v-if="current_timu && current_timu.answers">
                        <block v-for="(item, index) in current_timu.answers" :key="index" v-if="current_timu.type==1 || current_timu.type==2 ||current_timu.type==3">
                            <view class="questionBankAnswer-content-menu"
                                    @tap="post_answer(item, index)"
                                    :class="{font1: font_size_type === 1,font2: font_size_type === 2,font3: font_size_type === 3,font4: font_size_type === 4}">
                                <!-- 用户选择错误答案显示特殊样式 -->
                                <view
                                        class="questionBankAnswer-content-num"
                                        :class="{active : copy_user_answer &&  copy_user_answer[current_timu.id][index].active}">
                                    {{ item.answer_code === "1" ? "A" : item.answer_code === "0" ? "B" : item.answer_code }}
                                </view>
                                <view class="questionBankAnswer-content-txt">
									<rich-text :nodes="item.answer"></rich-text>
								<!-- {{item.answer }} -->
                                </view>
                            </view>
                        </block>
            			<block  v-if="current_timu.type==4">
            				<!-- <view  style="font-size:22rpx;color:red; margin-top: 10rpx;">
            					注*：可以选择输入答案或者拍照上传,两者选其一
            				 </view> -->
            				 <view v-if="current_timu.type_answer==2 "  style="  margin-top: 10rpx;border-radius: 20rpx; margin-bottom:20rpx"   > 
            				 
            					 <input v-if="tiankongArray[current_timu.id]" type="text" @input="onInput" :value="tiankongArray[current_timu.id]"  placeholder="请输入你的答案" placeholder-style="color:#666;" style="height: 80rpx; border: 1px solid #eee;  padding: 0 20rpx;margin-top:20rpx;border-radius:8rpx; " />
            					 <input v-else type="text" @input="onInput"   placeholder="请输入你的答案" placeholder-style="color:#666;" style="height: 80rpx; border: 1px solid #eee;  padding: 0 20rpx;margin-top:20rpx;border-radius:8rpx; " />
            				 </view>
							 <view  v-if="current_timu.type_answer==1 "  style="background:#f6f6f6;height: 300rpx;margin-top: 20rpx;border-radius: 20rpx;text-align:center;margin-bottom:20rpx" @tap="uploadImage" >
							 	<view v-if="imgurlArray[current_timu.id]">
							 		<image :src=" imgurlArray[current_timu.id]" mode="heightFix" style="max-height: 300rpx;"></image>
							 		 
							 	</view>
							 	<view v-else>
							 		<image src="../../../static/img/photo.png" mode="widthFix" style="width:100rpx;margin-top:80rpx"></image>
							 		<view style="font-size:28rpx;color:#e6e6e6">
							 			支持拍照上传
							 		</view>
							 	</view>
							 	
							 	 
							 	<!-- <input type="text" @input="onInput"   placeholder="请输入你的答案" placeholder-style="color:#666;" style="height: 80rpx; border: 1px solid #eee;  padding: 0 20rpx;margin-top:20rpx;border-radius:8rpx; " /> -->
							 </view>
            			</block>
            			<block  v-if="current_timu.type==5 || current_timu.type==8 || current_timu.type==9 || current_timu.type==10">
            			    
            				<!-- <block v-if="current_timu.type==4">
            				   <view style="  margin-top: 10rpx;border-radius: 20rpx; margin-bottom:20rpx"   >
            				   
            					   <input v-if="tiankongArray[current_timu.id]" type="text" @input="onInput" :value="tiankongArray[current_timu.id]"  placeholder="请输入你的答案" placeholder-style="color:#666;" style="height: 80rpx; border: 1px solid #eee;  padding: 0 20rpx;margin-top:20rpx;border-radius:8rpx; " />
            					   <input v-else type="text" @input="onInput"   placeholder="请输入你的答案" placeholder-style="color:#666;" style="height: 80rpx; border: 1px solid #eee;  padding: 0 20rpx;margin-top:20rpx;border-radius:8rpx; " />
            				   </view>
            				</block>
            				
            				<block v-else>
            				   <view style="  margin-top: 10rpx;border-radius: 20rpx; margin-bottom:20rpx"> 
            					   <textarea v-if="tiankongArray[current_timu.id]"   @input="onInput" :value="tiankongArray[current_timu.id]"  placeholder="请输入你的答案" placeholder-style="color:#666;" style="width:92%;height: 300rpx; border: 1px solid #eee;  padding:   20rpx;margin-top:20rpx;border-radius:8rpx; " />
            					   <textarea v-else   @input="onInput"   placeholder="请输入你的答案" placeholder-style="color:#666;" style="height: 300rpx; border: 1px solid #eee;  padding: 20rpx;margin-top:20rpx;border-radius:8rpx;width:92% " />
            				   </view>
            				</block> -->
            				<view style="background:#f6f6f6;height: 300rpx;margin-top: 20rpx;border-radius: 20rpx;text-align:center;margin-bottom:20rpx" @tap="uploadImage" > 
            					<view v-if="imgurlArray[current_timu.id]">
            						<image :src=" imgurlArray[current_timu.id]" mode="heightFix" style="max-height: 300rpx;"></image>
            						 
            					</view>
            					<view v-else>
            						<image src="../../../static/img/photo.png" mode="widthFix" style="width:100rpx;margin-top:80rpx"></image>
            						<view style="font-size:28rpx;color:#e6e6e6">
            							支持拍照上传
            						</view>
            					</view>
            					
            					 
            			    	<!-- <input type="text" @input="onInput"   placeholder="请输入你的答案" placeholder-style="color:#666;" style="height: 80rpx; border: 1px solid #eee;  padding: 0 20rpx;margin-top:20rpx;border-radius:8rpx; " /> -->
            			    </view>
            			</block>
            			<block  v-if="current_timu.type==6 || current_timu.type==7 ">
            				<view class="questionBankAnswer-title"><rich-text :nodes="current_timu.sonquestion_name"></rich-text></view>
            				<block v-for="(item, index) in current_timu.answers" :key="index" v-if="current_timu.sontype==1 || current_timu.sontype==2 ||current_timu.sontype==3">
            					<view class="questionBankAnswer-content-menu"
            							@tap="post_answer(item, index)"
            							:class="{font1: font_size_sontype === 1,font2: font_size_sontype === 2,font3: font_size_sontype === 3,font4: font_size_sontype === 4}">
            						<!-- 用户选择错误答案显示特殊样式 -->
            						<view
            								class="questionBankAnswer-content-num"
            								:class="{active : copy_user_answer &&  copy_user_answer[current_timu.id][index].active}">
            							{{ item.answer_code === "1" ? "A" : item.answer_code === "0" ? "B" : item.answer_code }}
            						</view>
            						<view class="questionBankAnswer-content-txt">
										<rich-text :nodes="item.answer"></rich-text>
									<!-- {{item.answer }} -->
            						</view>
            					</view>
            				</block>
            				
            			</block>
                    </view>
					<view style="margin-top:60rpx" v-if="current_timu.type==4 && current_timu.type_answer==2"
						  :class="{'font1': font_size_type === 1, 'font2': font_size_type === 2, 'font3': font_size_type === 3, 'font4': font_size_type === 4}">
						 <button class= "duoxuan"   type=""
								 @tap="post_answer_req"> 提交
						 </button>
					</view>
                    <view :class="{font1: font_size_type === 1,font2: font_size_type === 2,font3: font_size_type === 3,font4: font_size_type === 4}"
                            v-if="current_timu.answers && current_timu.type == 2">
                        <button
                                :class="is_duoxuan_sub ? 'duoxuan_checked' : 'duoxuan'"
                                type=""
                                @tap="post_answer_req"
                        >
                            {{ is_duoxuan_sub ? "提交成功" : "选择后点击提交" }}
                        </button>
                    </view>
                </scroll-view>
            </swiper-item>
            
			<swiper-item>
                <scroll-view scroll-y style="height: 100%;">
                    <view class="questionBankAnswer"
                            :class="{font1: font_size_type === 1,font2: font_size_type === 2,font3: font_size_type === 3,font4: font_size_type === 4}"
                            v-if="next_timu && next_timu.id">
                        <view class="questionBankAnswer-flex">
                            <view class="questionBankAnswer-top-l">
                                <view class="questionBankAnswer-top">
                                    <span style="font-size:18px;font-weight: 700;">
                                		第{{ timu_order  }}题
                                	</span>
                                </view>
                                <view class="questionBankAnswer-tx">
									<span v-if="next_timu.type == 1">
										单选
									</span>
									<span v-if="next_timu.type == 2">
										多选
									</span>
									<span v-if="next_timu.type == 3">
										判断
									</span>
									<span v-if="next_timu.type == 4">
										填空
									</span>
									<span v-if="next_timu.type == 5">
										简答
									</span>
									<span v-if="next_timu.type == 6">
										阅读理解
									</span>
									<span v-if="next_timu.type == 7">
										完形填空
									</span>
									<span v-if="next_timu.type == 8">
										翻译
									</span>
									<span v-if="next_timu.type == 9">
										写作
									</span>
								<!-- {{ next_timu.type == 1 ? "单选" : next_timu.type == 2 ? "多选" : "判断" }} -->
                                </view>
                            </view>
                        </view>
                        <view class="questionBankAnswer-title">{{ next_timu.answer }}</view>
                    </view>
                    <!-- type 1单选 2多选 3判断 -->
                    <view
                            class="questionBankAnswer-content"
                            :class="{font1: font_size_type === 1,font2: font_size_type === 2,font3: font_size_type === 3,font4: font_size_type === 4}"
                            v-if="next_timu && next_timu.answers">
                        <block v-for="(item, index) in next_timu.answers" :key="index">
                            <view class="questionBankAnswer-content-menu">
                                <view class="questionBankAnswer-content-num">
                                    {{ item.answer_code }}
                                </view>
                                <view class="questionBankAnswer-content-txt">
									<rich-text :nodes="item.answer"></rich-text>
								<!-- {{ item.answer }} -->
                                </view>
                            </view>
                        </block>
                    </view>
                </scroll-view>
            </swiper-item>
        </swiper>
        <ifguide ref="ifguide"></ifguide>
		<!-- <view  style="display:flex;width:70%;margin:0 auto;justify-content: space-between;padding-top:20rpx">
			<view class="downUpView" style="background:#e8f7e8;color:#60c25f" @tap="upTest(timu_order)">
				上一题
			</view>
			<view class="downUpView" style="color:#ff7877" @tap="downTest(timu_order)">
				下一题
			</view>
		</view> -->
        <view class="order-pay">
			<view @tap="upTest(timu_order)">
				<image v-if="timu_order-1<1" src="../../../static/img/btn-cuo.png"></image>
				<image v-else  style="width: 50rpx;height: 50rpx;"   src="https://shuati26.kptedu.com/uploads/image/btn-left.png"></image>
				
				
				<text style="margin-left: -8px;">上一题</text>
			</view>
			<view class="questionBankAnswer-dc djs">
			    <image src="https://shuati26.kptedu.com/uploads/image/btn-time.png"></image>
			    <view v-if="over_time">
			        <uni-countdown
			                :show-day="false"
			                color="#fff"
			                background-color="#3c7bfc"
			                border-color="#3c7bfc"
			                :hour="over_time.hour"
			                @timeup="timeup"
			                :minute="over_time.minute"
			                :second="over_time.second"
			        >
			        </uni-countdown>
			    </view>
			</view>
			 
			 
			 <view class="questionBankAnswer-r" @tap="show_choice_timu_list = true">
			     <image src="https://shuati26.kptedu.com/uploads/image/btn-type.png"></image>
			     <view class="questionBankAnswer-r-menu" style="font-size: 22rpx;" >
			         <span>{{ timu_order }}</span>
			         /{{ total_num }}
			     </view>
			 </view>
			 <view class="questionBankAnswer-bottom">
			     <view class="questionBankAnswer-bottom-flex" @click="over_dati()">
			         <image src="https://shuati26.kptedu.com/uploads/image/btn-jiaojuan.png"></image>
			         <view>交卷</view>
			     </view>
			 </view>
			 <view @tap="downTest(timu_order)">
				 <image v-if="timu_order + 1 > total_num"  src="../../../static/img/btn-cuo.png"></image>
			 	<image v-else style="width: 50rpx;height: 50rpx;" src="https://shuati26.kptedu.com/uploads/image/btn-right.png"></image>
			 	
				
				<text style="margin-left: -3px;">下一题</text>
			 </view>
            
            
            <!-- <view class="questionBankAnswer-r" @tap="show_choice_timu_list = true">
                <view
                        class="iconfont icon-fenlei"
                        @tap="show_choice_timu_list = true"
                ></view>
                <view class="questionBankAnswer-r-menu">
                    <span>{{ timu_order }}</span>
                    /{{ total_num }}
                </view>
            </view> -->
        </view>

        <view
                class="order-pay-z"
                v-if="show_choice_timu_list"
                @tap="show_choice_timu_list = false"
        ></view>
        <view class="tika" v-if="show_choice_timu_list">
            <view class="order-pay1">
                <view class="questionBankAnswer-bottom">
                    <view class="questionBankAnswer-bottom-flex" @tap="jiaojuan">
                        <view class="iconfont icon-lianxi_"></view>
                        <view>交卷</view>
                    </view>
                </view>
                <view class="questionBankAnswer-dc djs">
                    倒计时:
                    <view v-if="over_time">
                        <uni-countdown
                                :show-day="false"
                                color="#fff"
                                background-color="#3c7bfc"
                                border-color="#3c7bfc"
                                :hour="over_time.hour"
                                @timeup="timeup"
                                :minute="over_time.minute"
                                :second="over_time.second"
                        >
                        </uni-countdown>
                    </view>
                </view>
                <view class="questionBankAnswer-r">
                    <view class="iconfont icon-fenlei"></view>
                    <view class="questionBankAnswer-r-menu">
                        <span>{{ timu_order }}</span>
                        /{{ total_num }}
                    </view>
                </view>
            </view>
            <view class="tika-content">
                <block v-for="(item, index) in timu_list" :key="index">
                    <view
                            @tap="choice_timu_by_id(index)"
                            class="tika-content-n orange-background"
                            v-if="item.state === 1"
                    >{{ index + 1 }}
                    </view
                    >
                    <view
                            class="tika-content-n"
                            v-else-if="item.state === 0"
                            @tap="choice_timu_by_id(index)"
                    >{{ index + 1 }}
                    </view
                    >
                </block>
            </view>
        </view>

        <view
                class="order-pay-z"
                v-if="show_change_moshi"
                @tap="show_change_moshi = false"
        ></view>
        <view class="tika" v-if="show_change_moshi" style="height: 150px;">
            <view class="tika-content">
                <view class="uni-list">
                    <view class="uni-list-cell uni-list-cell-pd">
                        <view class="uni-list-cell-db">夜间模式</view>
                        <switch color="#3c7bfc" :checked="if_theme_dark" @change="set_if_theme_dark"/>
                    </view>
                    <view class="uni-list-cell uni-list-cell-pd" style="position: relative;width: 100%;">
                        <slider activeColor="#3c7bfc" backgroundColor="#3c7bfc"
                                @change="set_font_size_type"
                                :value="font_size_type"
                                :min="1"
                                :step="1"
                                :max="4"
                                style="width: 92%;margin: 7px 0;height: 100%;"
                        />
                    </view>
                </view>
            </view>
        </view>
        <overtimu
                v-if="show_over_dati"
                :timuinfo="over_dati_info"
                @tap_handler="jiaojuan"
        ></overtimu>
		<view style="height: 200rpx;">
			
		</view>
    </view>
</template>

<script>
    import overtimu from "@/components/overtimu/index";
    import uniCountdown from "@/components/uni-countdown/uni-countdown.vue";
    import ifguide from "@/components/if-guide/index";
    import {mapState} from "vuex";
	

    export default {
        data() {
            return {
                exam_id:0,//考试id
                total_num:0,//试题总数
                // 上次答到第几题
                timu_order: -1,
                //区分多选题是否点击提交按钮
                is_duoxuan_sub: false,
                // 答题、背题模式
                show_beiti: false,
                // 上一题
                last_timu: {},
                // 当前题目
                current_timu: {},
                // 下一题
                next_timu: {},
                // 用户输入的答案
                copy_user_answer: {},
                copy_right_answer_code: {},
                copy_post_status: {},
                // 是否显示退出答题弹框
                show_over_dati: false,
                over_dati_info: {},
                // 用于swiper组件的current更新
                current: 1,
                old: {
                    current: 1
                },
                // 答题开始时间
                start_time: 0,
                end_time: 0,
                // 页面参数
                pages_params: {},
                // 显示购买vip
                show_buy_options: false,
                // 显示答题卡
                show_choice_timu_list: false,
                // 答题卡
                timu_list: [],
                kaoshi_id: "",
                // 字号大小
                show_change_moshi: false,
                font_size_type: 2, // 4种级别
                if_theme_dark: false ,// 黑夜模式,
			    imgUrl :'',
				imgurlArray:[],
				tiankong_answer:'',
				tiankongArray:[],
				y: 360,
				uphg: 360, 
				windowHeight:'',
				belowhg:'',
				noticetext:'温馨提示，考试过程中返回将不记录考试成绩，切勿进行返回',
            };
        },
        onShow() {

            // this.get_timu_info();
        },
        onLoad(opts) {

            this.pages_params = opts;
            //this.exam_id = this.pages_params.id
			this.exam_id = this.pages_params.id
            this.end_time = this.pages_params.end_time
            this.get_timu_list();
			this.belowhg=uni.getWindowInfo().windowHeight - 457
			this.windowHeight = uni.getWindowInfo().windowHeight
        },
		onReady(){
			this.$refs.ifguide.if_guide();
		},
        computed: {
            ...mapState(["subject", "userinfo"]),
            over_time() {
                if (this.end_time > 0) {
                    let end = parseInt(new Date().getTime() / 1000);
                    let sec = parseInt(this.end_time - end);
                    let hour = parseInt(sec / 3600);
                    let miu = parseInt((sec - hour * 3600) / 60);
                    let s = sec - hour * 3600 - miu * 60;
                    return {
                        hour: parseInt(hour),
                        minute: parseInt(miu),
                        second: parseInt(s)
                    };
                }
                return false;
            }
        },
		//中途退出
        onBackPress() {
            this.over_dati();
            return true;
        },
        components: {
            overtimu,
            uniCountdown,
            ifguide,
			
        },
        methods: {

            timeup() {
                this.jiaojuan();
            },
			move (t){
			   
				var that=this
			    if ("touch" == t.detail.source) { 
			            var e = that.windowHeight-70, n = t.detail.y; 
			            n < 30 && (n = 30, that.y= 30),that.uphg=n,that.belowhg=e - n - 84;
			 
			    }
			},
			// 上传图片
			uploadImage(){
				const that = this
				
			 
					uni.chooseImage({
						count: 1, // 最多可以选择的图片张数，默认9
						sizeType: ['original', 'compressed'], //original 原图，compressed 压缩图，默认二者都有
						sourceType: ['album', 'camera'], //album 从相册选图，camera 使用相机，默认二者都有。如需直接开相机或直接选相册，请只使用一个选项
						success: function (res) {
							
							// that.tempFilePaths = res.tempFilePaths[0]; 
							 uni.uploadFile({
							 	url: that.$myConfig.api + 'api/common/upload?token=' + that.userinfo.token, //仅为示例，非真实的接口地址
							 	filePath: res.tempFilePaths[0],
							 	header: {token: that.userinfo.token},
							 	name: 'file',
							 	formData: {
							 		'user': 'test'
							 	},
							 	success: (uploadFileRes) => {
							 		if (uploadFileRes) {
										let res = JSON.parse(uploadFileRes.data);
										
										that.imgUrl=res.data.fullurl
										that.imgurlArray[that.current_timu.id]=res.data.fullurl
										that.post_answer_req();
							             
							 		}
							 	}
							 });
						}
					}) 
			},
					 
            // 获取答题卡
            //2020年2月1日——创建一个答题卡数组   is_dati    1已答  0未答 
            async get_timu_list() {
                let res = await this.$myHttp.post({
                    url: this.$myHttp.urlMap.examCard,
                    data: {
                        exam_id: this.exam_id // 考试id
                    },
                    needLogin: true
                });

                if (res.code == 1) {
					
                    this.timu_list = res.data;
                    this.total_num = this.timu_list.length;
                    this.get_timu_order();
                }
            },
			
            // 获取用户答到第几题
            async get_timu_order() {
                let res = await this.$myHttp.post({
                    url: this.$myHttp.urlMap.examPosition,
                    data: {
                        exam_id:this.exam_id
                    },
                    needLogin: true
                });

                if (res.code == 1) {
					
                    this.timu_order = res.data
                    this.get_timu_info();
                }
            },
            async get_timu_info() {
                let res = await this.$myHttp.post({
                    url: this.$myHttp.urlMap.exam_timu_details,
                    data: {
                        exam_id:this.exam_id,
                        question_id:this.timu_list[this.timu_order-1].id
                    },
                    needLogin: true
                });

                if (res.code == 1) {
					
                    if (res.data != []) { 
						  
                        this.current_timu = res.data;
						this.imgurlArray[this.current_timu.id]=res.data.imgurl
                        this.save_user_answer(this.current_timu);
                        if (this.current_timu.user_answer) {
                            this.show_user_answer(
                                this.current_timu.id,
                                this.current_timu.user_answer,
                                this.current_timu.type
                            );
                        }
						// if(this.current_timu.type==6 || this.current_timu.type==7){
					
						  
						// }else{
						// 	this.belowhg=uni.getWindowInfo().windowHeight - 457
						// 	this.y=360
						// 	this.uphg=360   
						// } 
                    } else {
                        this.current_timu = null; 
                    }
                    // 获取上一题，下一题
                    this.$nextTick(() => {
                        if(this.total_num > 1){
                            if(this.timu_order == 1){
                                this.last_timu = null;
                                this.get_timu('next');
                            }else if(this.timu_order > 1 && this.timu_order < this.total_num){
                                this.get_timu('pre');
                                this.get_timu('next');
                            }else if(this.timu_order == this.total_num){
                                this.get_timu('pre');
                                this.next_timu = null;
                            }
                        }else if(this.total_num == 1){
                            this.last_timu = null;
                            this.next_timu = null;
                        }
                    });
                } else {
                    uni.navigateBack({});
                }
            },
            //获取上一题、下一题  pre 上一题  next 下一题
            async get_timu(type){
                let data = {}
                if(type == 'pre'){
                    data={
                        exam_id:this.exam_id,
                        question_id : this.timu_list[this.timu_order-2].id
                    }
                }else if (type == 'next'){
                    data = {
                        exam_id: this.exam_id,
                        question_id: this.timu_list[this.timu_order].id
                    }
                }
                let res = await this.$myHttp.post({
                    url: this.$myHttp.urlMap.exam_timu_details,
                    data: data,
                    needLogin: true
                });
                if (res.code == 1) {
                    if (res.data !=[]) {
						if(this.current_timu.type==6 || this.current_timu.type==7){
							 
						  
						}else{
							this.belowhg=uni.getWindowInfo().windowHeight - 457
							this.y=360
							this.uphg=360   
						} 
                        let timu = this.set_right_flg(res.data); 
                        if(type == 'pre'){
                            this.last_timu = timu;
                            this.save_user_answer(this.last_timu);
                            if (this.last_timu.user_answer) {
                                this.show_user_answer(
                                    this.last_timu.id,
                                    this.last_timu.user_answer,
                                    this.last_timu.type
                                );
                            }
                        }else{
							
                            this.next_timu = timu;
                            this.save_user_answer(this.next_timu);
                            if (this.next_timu.user_answer) {
                                this.show_user_answer(
                                    this.next_timu.id,
                                    this.next_timu.user_answer,
                                    this.next_timu.type
                                );
                            }
                        }
                    }
                }
            },
            // 根据答题卡获取题目
            async choice_timu_by_id(index) {
                this.timu_order = index + 1
                this.get_timu_info()
            },

            //考试时显示用户已经答题的选项
            show_user_answer(id, answer, type) {
                if (this.copy_user_answer[id]) {
                    // 如果是判断和单选。执行以下处理
                    if (type == 1 || type == 3) {
                        for (let i = 0, leng = this.copy_user_answer[id].length; i < leng; i++) {
                            if (this.copy_user_answer[id][i].answer_code.toString().toLowerCase().replace(/\s/g, "") == answer.toString().toLowerCase().replace(/\s/g, "")) {
                                this.copy_user_answer[id][i].active = true;
                            } else {
                                this.copy_user_answer[id][i].active = false;
                            }
                        }
                    } else {
                        for (let i = 0, leng = answer.length; i < leng; i++) {
                            for (let j = 0, len = this.copy_user_answer[id].length; j < len; j++) {
                                if (this.copy_user_answer[id][j].answer_code.toString().toLowerCase().replace(/\s/g, "") == answer[i].toString().toLowerCase().replace(/\s/g, "")) {
                                    this.copy_user_answer[id][j].active = true;
                                } else {
                                    // this.copy_user_answer[id][j].active = false;
                                }
                            }
                        }
                    }
                }
            },
            // 设置正确答案的标记
            set_right_flg(timu) {
                if (timu) {
                    if (timu.answers) {
                        for (let i = 0, leng = timu.answers.length; i < leng; i++) {
                            if (
                                timu.right_answer
                                    .toString()
                                    .toLowerCase()
                                    .replace(/\s/g, "")
                                    .indexOf(
                                        timu.answers[i].answer_code
                                            .toString()
                                            .toLowerCase()
                                            .replace(/\s/g, "")
                                    ) !== -1
                            ) {
                                timu.answers[i]["right_flg"] = true;
                            }
                        }
                    }
                }
                return timu;
            },
            // 本地存储用户答案
            save_user_answer(timu) {
                if (timu && timu.answers) {
                    if (!this.copy_user_answer[timu.id]) {
                        this.copy_user_answer = Object.assign({}, this.copy_user_answer, {
                            [timu.id]: []
                        });
                        this.copy_right_answer_code = Object.assign(
                            {},
                            this.copy_right_answer_code,
                            {
                                [timu.id]: timu.right_answer
                            }
                        );
                        this.copy_post_status = Object.assign({}, this.copy_post_status, {
                            [timu.id]: false
                        });
                        this.copy_post_answer_right = Object.assign(
                            {},
                            this.copy_post_answer_right,
                            {
                                [timu.id]: false
                            }
                        );

                        for (let i = 0, leng = timu.answers.length; i < leng; i++) {
                            this.copy_user_answer[timu.id].push({
                                answer_code: timu.answers[i].answer_code,
                                error_flg: false,
                                active: false
                            });
                        }
                    }
                }
            },
			downTest(e){
				//    async choice_timu_by_id(index) {
			    // this.timu_order = index + 1
			    // this.get_timu_info()
			// },
			
				
				 if(e + 1 > this.total_num){
					let that = this;
					uni.showModal({
					    title: "提示",
					    content: "将通过已完成的题目生成考试成绩，您确认不在答题吗？",
					    confirmText: "提交交卷",
					    cancelText: "检查试卷",
					    confirmColor:'#3c7bfc',
					    cancelColor:'#acacac',
					    success: function (res) {
					        if (res.confirm) {
					            that.jiaojuan();
					        } else if (res.cancel) {
					            console.log("用户点击取消");
					        }
					    }
					});
					 
				 }else{
					 this.timu_order = e + 1
					 this.get_timu_info()
				 }
				
				 
			},
			upTest(e){
				
				 if(e - 1 < 1){
					this.$myUtils.$prompt.showToast({
					    icon: 'none',
					    title: '没有上一题'
					});
				 					 
				 }else{
					 this.timu_order = e - 1
					 this.get_timu_info()
				 }
			},
			
            // 切换swiper
            swiper_change(e) {
                this.is_duoxuan_sub = false;
                this.old.current = e.detail.current;
                // 上一题
                if (e.detail.current === 0) {
                    if (this.last_timu) {
                        this.next_timu = this.current_timu;
                        this.current_timu = this.last_timu;

                        this.$nextTick(() => {
                            this.timu_order = this.timu_order -1;
                            if(this.timu_order == 1){
                                this.last_timu = null;
                            }else{
                                this.get_timu('pre');
                            }
                        });
                    } else {
                        this.$myUtils.$prompt.showToast({
                            icon: 'none',
                            title: '没有上一题'
                        });
                    }
                }
                // 下一题
                if (e.detail.current === 2) {
                    if (this.next_timu) {
                        this.last_timu = this.current_timu;
                        this.current_timu = this.next_timu;
                        this.$nextTick(() => {
                            this.timu_order = this.timu_order +1;
                            if(this.timu_order == this.total_num){
                                this.next_timu = null;
                            }else{
                                this.get_timu('next');
                            }
                        });
                    } else {
                        let that = this;
                        uni.showModal({
                            title: "提示",
                            content: "已没有下一题",
                            confirmText: "立即交卷",
                            confirmColor:'#3c7bfc',
                            success: function (res) {
                                if (res.confirm) {
                                    that.jiaojuan();
                                } else if (res.cancel) {
                                    console.log("用户点击取消");
                                }
                            }
                        });
                    }
                }
                this.current = this.old.current;
                this.$nextTick(function () {
                    this.current = 1;
                });
            },
            // 提交答案
            post_answer(item, index) {
                // 如果背题模式，不做处理
                if (this.show_beiti) {
                    return;
                }
                // 如果是判断和单选。执行以下处理
                if (this.current_timu.type == 1 || this.current_timu.type == 3 || this.current_timu.sontype == 1) {
                    this.$nextTick(() => {
                        if (this.copy_user_answer[this.current_timu.id]) {
                            for (let i = 0, leng = this.copy_user_answer[this.current_timu.id].length; i < leng; i++) {
                                this.copy_user_answer[this.current_timu.id].splice(i, 1, {
                                    ...this.copy_user_answer[this.current_timu.id][i],
                                    active: false,
                                    error_flg: false
                                });
                            }
                            if (this.current_timu.right_answer.toString().toLowerCase().replace(/\s/g, "").indexOf(item.answer_code.toString().toLowerCase().replace(/\s/g, "")) === -1) {
                                this.copy_user_answer[this.current_timu.id].splice(index, 1, {
                                    ...this.copy_user_answer[this.current_timu.id][index],
                                    active: true,
                                    error_flg: true
                                });
                            } else {
                                this.copy_user_answer[this.current_timu.id].splice(index, 1, {
                                    ...this.copy_user_answer[this.current_timu.id][index],
                                    active: true,
                                    error_flg: false
                                });
                            }
                        }
                        this.post_answer_req();
                    });
                } else {
                    if (this.copy_user_answer[this.current_timu.id]) {
                        if ((this.is_duoxuan_sub = true)) {
                            this.is_duoxuan_sub = false;
                        }
                        if (this.copy_user_answer[this.current_timu.id][index]) {
                            if (this.copy_user_answer[this.current_timu.id][index].active) {
                                if (this.current_timu.right_answer.toString().toLowerCase().replace(/\s/g, "").indexOf(item.answer_code.toString().toLowerCase().replace(/\s/g, "")) === -1) {
                                    this.copy_user_answer[this.current_timu.id].splice(index, 1, {
                                        ...this.copy_user_answer[this.current_timu.id][index],
                                        active: false,
                                        error_flg: true
                                    });
                                } else {
                                    this.copy_user_answer[this.current_timu.id].splice(index, 1, {
                                        ...this.copy_user_answer[this.current_timu.id][index],
                                        active: false,
                                        error_flg: false
                                    });
                                }
                            } else {
                                if (this.current_timu.right_answer.toString().toLowerCase().replace(/\s/g, "").indexOf(item.answer_code.toString().toLowerCase().replace(/\s/g, "")) === -1) {
                                    this.copy_user_answer[this.current_timu.id].splice(index, 1, {
                                        ...this.copy_user_answer[this.current_timu.id][index],
                                        active: true,
                                        error_flg: true
                                    });
                                } else {
                                    this.copy_user_answer[this.current_timu.id].splice(index, 1, {
                                        ...this.copy_user_answer[this.current_timu.id][index],
                                        active: true,
                                        error_flg: false
                                    });
                                }
                            }
                        }
                    }
					
					var userAnswer=this.copy_user_answer[this.current_timu.id]
					 var length=0
					for(var i=0;i<userAnswer.length;i++){
						if(userAnswer[i].active){
						    length++;	
						}
					}
					if(length<2){
						uni.showToast({
						    title: '这是多选题呦，至少还有一个答案',
						    duration: 2000,
							icon:'none'
						});
					}
                }
            },
			onInput(e){
				 
				 this.tiankong_answer = e.detail.value
				
			},
            // 提交答案
            async post_answer_req() {
                this.is_duoxuan_sub = true;
                let answers = this.copy_user_answer[this.current_timu.id];
                let answer = "";
                for (let i = 0, leng = answers.length; i < leng; i++) {
                    if (answers[i].active) {
                        answer += answers[i].answer_code;
                    }
                }
                this.copy_post_status = Object.assign({}, this.copy_post_status, {
                    [this.current_timu.id]: true
                });
                //
                if (
                    this.current_timu.right_answer
                        .toString()
                        .toLowerCase()
                        .replace(/\s/g, "") ===
                    answer
                        .toString()
                        .toLowerCase()
                        .replace(/\s/g, "")
                ) {
                    this.copy_post_answer_right = Object.assign(
                        {},
                        this.copy_post_answer_right,
                        {
                            [this.current_timu.id]: true
                        }
                    );
                }

                let res = await this.$myHttp.post({
                    url: this.$myHttp.urlMap.exam_answer,
                    data: {
                        question_id: this.current_timu.id,
                        exam_id: this.exam_id,
                        answer: answer,
						imgUrl:this.imgUrl,
						tiankong_answer:this.tiankong_answer
                    },
                    needLogin: true
                });
				
				if(this.current_timu.type==4 && this.current_timu.type_answer==2){
					uni.showToast({
					  icon: 'none',
					  title: '已提交'
					});
				}

                let timu_index = -1;
                for (let i = 0, leng = this.timu_list.length; i < leng; i++) {
                    if (this.current_timu.id === this.timu_list[i].id) {
                        timu_index = i;
                        break;
                    }
                }

                if (res.code == 1 && res.msg) {
					 this.tiankongArray[this.current_timu.id]=this.tiankong_answer
                    if (timu_index !== -1) {
                        this.timu_list[timu_index].state = 1;
                    }
                }
            },
            async jiaojuan() {
                if (this.exam_id) {
                    let res = await this.$myHttp.post({
                        url: this.$myHttp.urlMap.exam_end,
                        data: {
                            exam_id: this.exam_id
                        },
                        needLogin: true
                    });
                    if (res.code == 1) {
                        this.$myCatch.setItem("jiaojuan_info", res.msg);
                        this.tap_handler();
                    } else {
                        uni.navigateBack({
                            delta: 1
                        });
                    }
                } else {
                    uni.navigateBack({
                        delta: 1
                    });
                }
            },
            // 收藏
            async collect_opt() {
                let res = await this.$myHttp.post({
                    url: this.$myHttp.urlMap.tikushoucangeedit,
                    data: {
                        id: this.current_timu.id
                    },
                    needLogin: true
                });
                if (res.code == 1 && res.msg) {
                    this.$myPrompt.showToast({
                        icon: "none",
                        title: "收藏成功"
                    });
                }
            },
            // 中途退出
            over_dati() {
                let that = this;
                that.$myUtils.$prompt.showModal({
                    title: "提示",
                    content: "将通过已完成的题目生成考试成绩，您确认不在答题吗？",
                    
                    success: function (res) {
                        if (res.confirm) {
                            that.jiaojuan();
                        } else if (res.cancel) {
                            console.log("用户点击取消");
                        }
                    }
                });
            },
            // 设置字号大小
            set_font_size_type(e) {
                // font_size_type
                this.font_size_type = e.detail.value;
            },
            // 设置是否黑夜模式
            set_if_theme_dark(e) {
                // if_theme_dark
                this.if_theme_dark = e.target.value;
            },
            tap_handler(type) {
                if (type == 0) {
                    this.show_over_dati = false;
                } else {
                    this.$redirectTo("/pages/examination/examOver/index?exam_id="+this.exam_id);
                }
            },
			
			
        }
    };
</script>

<style>
    page {
        background: #fff;
    }
	.downUpView{
		width:150rpx;
		height:66rpx;
		line-height:66rpx;
		text-align:center; 
		background:#ffdbdb;
		font-size:28rpx;
		font-weight:600;
		border-radius:40rpx
	}

    .index-head-top .index-head-l {
        width: 20%;
        display: flex;
        align-items: center;
    }

    .index-head-top .index-head-m {
        width: 80%;
        text-align: center;
        display: flex;
        font-size: 18px !important;
        justify-content: center;
        align-items: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        height: 38px;
    }

    .exam {
        font-size: 18px;
    }

    .exam-flex {
        display: flex;
        width: 70%;
        margin-left: 18px;
    }

    .moshi-active {
        background: #fff;
        color: #367ef0;
        height: 28px;
        border-radius: 5px;
        text-align: center;
        line-height: 28px;
        padding: 0 10px;
        width: 80px;
    }

    .moshi {
        border: #fff solid 1px;
        color: #ffffff;
        height: 28px;
        border-radius: 5px;
        text-align: center;
        line-height: 28px;
        padding: 0 10px;
        margin-left: 6px;
        width: 80px;
    }

    .index-head-top .index-head-r {
        width: 20%;
        text-align: right;
    }

    .index-head-r .iconfont {
        font-size: 24px;
    }

    .index-head-top .index-head-l .icon {
        font-size: 20px;
    }

    .questionBankAnswer {
        background: #fff;
        border-bottom: solid 1px #f6f7f9;
        padding: 16px;
        font-size: 16px;
    }

    .questionBankAnswer-flex {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
    }

    .questionBankAnswer-top-l {
        display: flex;
        font-size: 16px;
        align-items: center;
    }

    .questionBankAnswer-top {
        color: #9a9a9a;
    }

    .questionBankAnswer-top span {
        color: #000;
        font-weight: bold;
    }

  .questionBankAnswer-tx {
      background: #efefef;
          color: #9c9c9c;
          padding: 5rpx 10rpx;
          font-size: 10px;
          margin-left: 8px;
          border-radius: 10rpx;
  }

    .questionBankAnswer-top-r {
        color: #ababab;
        font-size: 13px;
    }

    .questionBankAnswer-title {
        margin-top: 8px;
    }

    .questionBankAnswer-content {
        padding: 0 16px;
        margin-bottom: 0;
    }

    .questionBankAnswer-content .active-bg {
        background: #e8f7e8;
    }
    .questionBankAnswer-content .error-bg {
        background: #feeceb;
    }

    .questionBankAnswer-content-menu {
        display: flex;
        align-items: center;
        margin: 13px 0;
        background: #f7f7f7;
        padding: 13px;
        border-radius: 6px;
    }

    .questionBankAnswer-content-num {
        width: 30px;
        height: 30px;
        line-height: 30px;
        text-align: center;
        border-radius: 50%;
        color: #5a5a5a;
        margin-top: 2px;
        font-size: 18px;
    }

    .questionBankAnswer-content-menu .active {
        background: #3c7bfc;
        color: #fff;
        position: relative;
    }

    .questionBankAnswer-content-menu .error {
        background: red;
        color: #fff;
    }

    .questionBankAnswer-content-txt {
        flex: 1;
        margin-left: 12px;
        color: #5a5a5a;
    }

    .order-pay {
       
		
		background: #fff;
		    position: fixed;
		    bottom: 0;
		    width: 100%;
		    font-size: 20rpx;
		    border-top: solid 1px #eee;
		    z-index: 100;
		    display: flex;
		    justify-content: space-around;
		    padding: 8px 0;
			
    }

    .questionBankAnswer-bottom {
        flex: 0 0 20%;
        display: flex;
        font-size: 14px;
    }

    /* .questionBankAnswer-bottom-flex {
        display: flex;
        align-items: center;
        flex: 1;
    } */

    .questionBankAnswer-bottom-flex .icon {
        margin-right: 4px;
        font-size: 18px;
    }

    /* .questionBankAnswer-bottom .questionBankAnswer-bottom-flex:first-child {
        padding-left: 14px;
        color: #00;
    } */

    .djs {
        line-height: 25px;
    }

    .djs span {
        color: #367ef0;
        font-weight: bold;
        font-size: 16px;
    }

    .questionBankAnswer-dc {
        /*flex: 1;*/
        justify-content: center;
        display: flex;
        font-size: 14px;
        margin-right: 10px;
    }

    .questionBankAnswer-dc .questionBankAnswer-dc-flex:first-child {
        display: flex;
        align-items: center;
        text-align: center;
        color: #0ec358;
        padding: 0 14px;
    }

    .questionBankAnswer-dc-flex .icon {
        font-size: 18px;
    }

    .questionBankAnswer-dc .questionBankAnswer-dc-flex:last-child {
        display: flex;
        align-items: center;
        color: #ff4c4c;
    }

    .questionBankAnswer-r {
        /* flex: 0 0 21%; */
        display: flex;
        font-size: 14px;
        align-items: center;
        color: #999;
    	flex-flow: column wrap;
    }

    .questionBankAnswer-r .icon {
        font-size: 22px;
    }

    .questionBankAnswer-r-menu span {
        color: #000;
        font-weight: bold;
    }

    /*收藏*/
    .collect .icon {
        color: #ffe51f;
    }

    .duoxuan {
        width: 92%;
        margin: 0 auto;
        background-color: #3c7bfc;
        color: #fff;
        border-radius: 30px;
        margin-bottom: 20px !important;
    }

    .duoxuan_checked {
        margin-bottom: 20px !important;
        width: 92%;
        margin: 0 auto;
        background-color: #d6d6d6;
        border-radius: 30px;
        color: #f8f8f8;
    }

    /*题卡*/
    .tika {
        background: #fff;
        position: absolute;
        bottom: 0;
        width: 100%;
        height: 400px;
        z-index: 100;
        overflow: hidden;
        overflow-y: scroll;
        border: none !important;
        left: 0 !important;
    }

    .order-pay1 {
        background: #fff;
        width: 100%;
        font-size: 18px;
        z-index: 100;
        display: flex;
        justify-content: center;
        padding: 8px 0;
        border-bottom: solid 1px #eee;
    }

    .tika-content {
        width: 100%;
    }

    .tika-content-n {
        float: left;
        text-align: center;
        width: 36px;
        height: 36px;
        border: solid 1px #eee;
        border-radius: 50%;
        margin: 7px;
        line-height: 36px;
        font-size: 15px;
    }

    .order-pay-z {
        background: rgba(0, 0, 0, 0.45);
        width: 100%;
        z-index: 100;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    /*字号和夜间模式*/
    .font1 {
        font-size: 12px !important;
    }

    .font2 {
        font-size: 15px !important;
    }

    .font3 {
        font-size: 25px !important;
    }

    .font4 {
        font-size: 35px !important;
    }

    .yejian,
    .yejian .index-head,
    .yejian .questionBankAnswer,
    .yejian .questionBankAnswer-jiexi-daan,
    .yejian .questionBankAnswer-jiexi-sj,
    .yejian .order-pay1,
    .yejian .tika {
        background: #3a3a3a !important;
        color: #7b7b7b !important;
        border-bottom: solid 1px #191919;
    }

    .yejian .questionBankAnswer-r-menu span {
        color: #fff;
        font-weight: bold;
    }
    .yejian .uni-list-cell-pd {
        background: #3a3a3a;
    }
    .yejian .moshi-active{
        background: #fff;
        color: #000;
    }
    .yejian .questionBankAnswer-content-menu {
        background: #000;
    }
    .yejian .questionBankAnswer-content-menu .active{
        background: #696969;
    }
    .yejian .tika-content-n {
        border: solid 1px #626262;
    }

    .yejian .index-head-m, .yejian .iconfont {
        color: #7b7b7b !important
    }
    .yejian .index-head-m,
    .yejian .icon {
        color: #7b7b7b !important;
    }

    .yejian .order-pay {
        border-top: solid 1px #191919;
        background: #3a3a3a !important;
        color: #7b7b7b !important;
    }

    .yejian .questionBankAnswer-tx {
        background: #545454;
        color: #a7a7a7;
    }

    .yejian .mnks {
        color: #7b7b7b !important;
    }
    .mnks {flex: 1;text-align: center;font-weight: bold}
    /* 列表 */
    .uni-list {
        background-color: #ffffff;
        position: relative;
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .uni-list:after {
        position: absolute;
        z-index: 10;
        right: 0;
        bottom: 0;
        left: 0;
        height: 1px;
        content: "";
        -webkit-transform: scaleY(0.5);
        transform: scaleY(0.5);
        background-color: none;
    }

    .uni-list::before {
        position: absolute;
        z-index: 10;
        right: 0;
        top: 0;
        left: 0;
        height: 1px;
        content: "";
        -webkit-transform: scaleY(0.5);
        transform: scaleY(0.5);
        background-color: #c8c7cc;
    }

    .uni-list-cell {
        position: relative;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .uni-list-cell-hover {
        background-color: #eee;
    }

    .uni-list-cell-pd {
        padding: 22upx 30upx;
    }

    .uni-list-cell-left {
        font-size: 28upx;
        padding: 0 30upx;
    }

    .uni-list-cell-db{
        font-size: 16px;
    }
    .uni-list-cell-db,
    .uni-list-cell-right {
        flex: 1;
    }

    .uni-list-cell::after {
        position: absolute;
        z-index: 3;
        right: 30upx;
        bottom: 0;
        left: 30upx;
        height: 1px;
        content: '';
        -webkit-transform: scaleY(.5);
        transform: scaleY(.5);
        background-color: #e4e4e4;
    }


    .uni-list .uni-list-cell:last-child::after {
        height: 0 upx;
    }

    .uni-list-cell-last.uni-list-cell::after {
        height: 0 upx;
    }

    .uni-list-cell-divider {
        position: relative;
        display: flex;
        color: #999;
        background-color: #f7f7f7;
        padding: 15 upx 20 upx;
    }

    .uni-list-cell-divider::before {
        position: absolute;
        right: 0;
        top: 0;
        left: 0;
        height: 1px;
        content: "";
        -webkit-transform: scaleY(0.5);
        transform: scaleY(0.5);
        background-color: #c8c7cc;
    }

    .uni-list-cell-divider::after {
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0 upx;
        height: 1px;
        content: "";
        -webkit-transform: scaleY(0.5);
        transform: scaleY(0.5);
        background-color: #c8c7cc;
    }

    .uni-list-cell-navigate {
        font-size: 30 upx;
        padding: 22 upx 30 upx;
        line-height: 48 upx;
        position: relative;
        display: flex;
        box-sizing: border-box;
        width: 100%;
        flex: 1;
        justify-content: space-between;
        align-items: center;
    }

    .uni-list-cell-navigate {
        padding-right: 36 upx;
    }

    .uni-navigate-badge {
        padding-right: 50 upx;
    }

    .uni-list-cell-navigate.uni-navigate-right:after {
        font-family: uniicons;
        content: "\e583";
        position: absolute;
        right: 24 upx;
        top: 50%;
        color: #bbb;
        -webkit-transform: translateY(-50%);
        transform: translateY(-50%);
    }

    .uni-list-cell-navigate.uni-navigate-bottom:after {
        font-family: uniicons;
        content: "\e581";
        position: absolute;
        right: 24 upx;
        top: 50%;
        color: #bbb;
        -webkit-transform: translateY(-50%);
        transform: translateY(-50%);
    }

    .uni-list-cell-navigate.uni-navigate-bottom.uni-active::after {
        font-family: uniicons;
        content: "\e580";
        position: absolute;
        right: 24 upx;
        top: 50%;
        color: #bbb;
        -webkit-transform: translateY(-50%);
        transform: translateY(-50%);
    }

    .uni-collapse.uni-list-cell {
        flex-direction: column;
    }

    .uni-list-cell-navigate.uni-active {
        background: #eee;
    }

    .uni-list.uni-collapse {
        box-sizing: border-box;
        height: 0;
        overflow: hidden;
    }

    .uni-collapse .uni-list-cell {
        padding-left: 20 upx;
    }

    .uni-collapse .uni-list-cell::after {
        left: 52 upx;
    }

    .uni-list.uni-active {
        height: auto;
    }

    .exam-tan-button {
        text-align: center;
        display: block !important;
    }
	
	.height50 {
	  overflow-y: scroll;
	  box-sizing: border-box;
	}
	.order-pay image{
		width: 40rpx;
		height: 40rpx;
		
	}
	.order-pay>view{
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		
	}
	
</style>
